<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="Veterinaria.modelo.Factura"%>
<html>
<meta http-equiv="Content-Type" content="text/html" charset="utf-8" />
<head>

<script type='text/javascript'> 
<!--
function MostrarDetalle(img, ancho, alto){  
	derecha=(screen.width-ancho)/2;  
	arriba=(screen.height-alto)/2;  
	string="toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width="+ancho+",height="+alto+",left="+derecha+",top="+arriba+"";  
	fin=window.open(img,"",string);
}
// -->
</script> 
<link rel="stylesheet" href="js/jquery/themes/base/jquery.ui.all.css">
<link href="css/ui-lightness/jquery-ui-1.8.22.custom.css" rel="Stylesheet" />
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.22.custom.min.js"></script>
<link rel="stylesheet" href="js/jquery/themes/demo/demos.css">
<script>
	$(function() {
		$("#txtDesde").datepicker({
			dateFormat : 'yy-mm-dd'
		});
	});
	$(function() {
		$("#txtHasta").datepicker({
			dateFormat : 'yy-mm-dd'
		});
	});

</script>
<title>Reporte de Factura - petVida - Veterinaria</title>
<style type="text/css">
<!--
.Estilo1 {	font-family: Tahoma;
	font-weight: bold;
	font-size: 18px;
}
.Estilo4 {font-family: Tahoma; font-weight: bold; font-size: 12px; }
.Estilo5 {font-family: Tahoma;  font-size: 10px;}
-->
</style>
</head>

<body>
<table width="1124" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><p align="left"><img src="img/logo3.jpg" alt="s" width="472" height="185" /></p></td>
    <td><p>&nbsp;</p>
        <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p align="right" class="Estilo1">Reporte Factura  </p></td>
  </tr>
  <tr bgcolor="#CCCCCC">
    <td height="10" colspan="2"><div align="right"></div></td>
  </tr>
</table>
<%@include file="navegador.jsp" %> 
<form name="form1" method="post" action="ReporteFacturasServlet">
      <table width="643" border="0" align="center">
        <tr class="Estilo4">
          <td width="104"><div align="right" class="Estilo4">
            <div align="center">idFactura</div>
          </div></td>
          <td><label></label>
              <label>
              <div align="center">IdDueno</div>
            </label></td>
          <td><div align="center">Desde</div></td>
          <td><div align="center">Hasta</div></td>
          <td><div align="center">Estado</div></td>
        </tr>
        <tr>
          <td class="Estilo4"><label>
            <input type="text" name="txtFactura" />
          </label></td>
          <td class="Estilo4"><label>
            <input type="text" name="txtDueno" />
          </label></td>
          <td class="Estilo4"><label>
            <div class="demo"><input name="txtDesde" id="txtDesde" type="text" id="txtDesde" size="10" />
           <td class="Estilo4"></div><label>
            <input name="txtHasta" id="txtHasta" type="text" id="txtHasta" size="10" />
          <td class="Estilo4"><label>
            <select name="select">
              <option></option>
              <option value="1">Activo</option>
              <option value="0">Desactivo</option>
            </select>
          </label></td>
        </tr>
        <tr>
          <td colspan="5"><label>
              <div align="center">
                <input type="submit" name="Submit" value="Buscar" />
              </div>
            </label></td>
        </tr>
      </table>
          </form>
      <p>&nbsp;</p>
      <table width="819" border="0" align="center">
        <tr>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td><table id="detalle" width="819" border="0" align="center">
            <tr bgcolor="#CCCCCC" class="Estilo4">
              <td><div align="center">idFactura</div></td>
              <td><div align="center">idDueno</div></td>
              <td><div align="center">Nombre</div></td>
              <td><div align="center">Fec Emisi&oacute;n </div></td>
              <td><div align="center">Total</div></td>
              <td><div align="center">Estado</div></td>
              <td><div align="center"></div></td>
              </tr>
             
              <%@page import="java.util.*, Veterinaria.modelo.Factura" %>
			<%
			Collection<Factura> arreglo = (ArrayList<Factura>)request.getAttribute("facturas");
			if(arreglo != null) { 
			int i = 1;
			for(Factura x : arreglo) {
			%>  
			
			  <tr class="Estilo5">
			   
			    <td><div align="center"><% out.print(x.getCod_factura()); %></div></td>
			    <td><div align="center"><% out.print(x.getoPersona().getCodigo_persona()); %></div></td>
			    <td><% out.print(x.getoPersona().getNombre_persona() + " " + x.getoPersona().getApellido_persona()); %></td>
			    <td><div align="center"><% out.print(x.getFecha_factura()); %></div></td>
			    <td><div align="right"><% out.print(x.getTotal()); %></div></td>
			    <% String estado;
			    if( x.getEstado().toString().equals("1") ){
			    	estado = "Activo";
			    }
			    else{
			    	estado = "Desactivo";	
			    }
			    %>
			    <td><div align="center"><% out.print(estado); %></div></td>
			    <td><div align="center"><a href="javascript:MostrarDetalle('DetalleFacturaServlet?id=<% out.print(x.getCod_factura()); %>','900','250')">Ver Detalle</a></div></td>     
			  </tr>
			 
			<% }  
			  } %>
            <tr>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
              <td>&nbsp;</td>
             <td>&nbsp;</td>
              </tr>
          </table>
             
        </tr>
      </table>
     
    <label></label></td>
  </tr>
  <tr>
    <td colspan="2" ><div align="center"><span class="Estilo4">Desarrollado por Grupo ThunderBolt<img src="img/Rayo.png" alt="s" width="28" height="21" /></span> </div></td>
  </tr>
</table>

<p></p>
</body>
</html>
